<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
        <%@ page import="com.pojo.OUser"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
OUser user = (OUser) session.getAttribute("user");
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd 

">
<html>
<head>
 <base href="<%=basePath%>">   
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>快速注册</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0"/>
    <meta name="format-detection" content="telephone=no, email=no"/>
    <link rel="stylesheet" href="css/common.css"/>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
    <link rel="stylesheet" type="text/css" href="lib/css/layer.css"/>
    <script src="lib/js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
    <script charset="utf-8" src="<%=basePath%>kindeditor/kindeditor-all.js"></script>
<script charset="utf-8" src="<%=basePath%>kindeditor/lang/zh_CN.js"></script>
<link rel="stylesheet" href="<%=basePath%>kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="<%=basePath%>kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="<%=basePath%>kindeditor/plugins/code/prettify.js"></script>
    <script type="text/javascript">
	var editor1;
	KindEditor.ready(function(K) {
		editor1 = K.create('textarea[name="content1"]', {
			cssPath : "kindeditor/plugins/code/prettify.css",
			uploadJson : 'kindeditor/jsp/upload_json.jsp',
			fileManagerJson : 'kindeditor/jsp/file_manager_json.jsp',
			allowFileManager : true,
			width:"90%",
			 afterCreate : function() {
				this.loadPlugin('autoheight');
			}, 
			 
			items : [ 'fullscreen', 'source', 'table', 'insertfile', 'link',
					'image', 'emoticons', '|', 'forecolor', 'hilitecolor',
					'bold', 'underline', 'removeformat', '|', 'justifyleft',
					'justifycenter', 'justifyright', 'preview' ]
			
		});
 
	});
</script>
<script type="text/javascript">
 
function changepwd(){
	var url = "xgmm.html";
	var mm={Password:"",Password1:"",Password2:""}
	mm.Password=$("#Password").val();
	mm.Password1=$("#Password1").val();
	mm.Password2=$("#Password2").val();
	for (var i in mm){
		if(mm[i]==""){
			alert("以上信息不能存在空值")
			return
	    }
	}
	if(mm.Password1!=mm.Password2){
		alert("两次输入的密码不一致");
		return ;
	}
	var m = mm;
	$.ajax({
		type : 'post',
		url : url,
		data : m,
		success : function(data) {
			if(data=="fpwd"){
				alert("你的初始密码错误，请重新输入");
			}else{
				alert("您的密码修改成功，请重新登录")
				window.location.href="applogin.html"
			} 
		}
	});
}
</script>
</head>
<body>
<body class="">
<div class="login_bg">
    <img src="img/login_bg.png">
    <div>
        <div class="register_title" style="display:none;">
            <a href="javascript:location.href='applogin.html'">
                <i class="icon"></i>
            </a>
            
        </div>
        <div class="register_content">
            <div class="register_part2">
               
               
                    <div class="item">
                    <input type="password" id="Password" placeholder="初始密码" oninput="if(value.length>11)value=value.slice(0,11)"
                           onkeyup="value = value.replace(/[^\d{2}\.]/g, '').replace(/(\.\d{2}).*/g, '$1')"/>
                </div>
                 <div class="item">
                    <input type="password" id="Password1" placeholder="新密码" oninput="if(value.length>11)value=value.slice(0,11)"
                           onkeyup="value = value.replace(/[^\d{2}\.]/g, '').replace(/(\.\d{2}).*/g, '$1')"/>
                </div>
                    <div class="item">
                    <input type="password" id="Password2" placeholder="确认密码" oninput="if(value.length>11)value=value.slice(0,11)"
                           onkeyup="value = value.replace(/[^\d{2}\.]/g, '').replace(/(\.\d{2}).*/g, '$1')"/>
                </div>  
                <input type="button" class="register_btn disabled" style="text-align: center"
                   id="register_btn" value="保存" onclick="changepwd()">
                <!--<input type="button" class="register_btn disabled" disabled id="register_btn" value="立即注册">-->

              
            </div>
          
        </div>
    </div>
    <div class="modal" id="modal"  style="display: none;">
        <img src="img/loading.svg" class="loadingImg" >
    </div>
</div>

</body>
<script src="lib/js/layer.js" type="text/javascript" charset="utf-8"></script>
<!--头部-->
<script src="lib/js/RainbowBridge.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    setTitle(".register_title", {'title': '快速注册'});
    function recommendFn(val) {
        if (val.length) {
            $.ajax({
                type: "GET",
                url: getAPIURL() + "Register/checkPromotion",
                dataType: "json",
                contentType: "application/json",
                data:{
                    account:val
                },
                success:function (data) {
                    if(data.rtn==1){
                        if(data.Message!=""&&data.Message!=null){
                            $("#recommendName").html(": &nbsp;&nbsp;"+data.Message)
                        }
                    }
                    else if(data.rtn==-1){
                        $("#recommendName").html("")
                    }
                }
            })
        }
    }
</script>
<script src="js/reg.js?v=1.2.2" type="text/javascript" charset="utf-8"></script>
</html>
